<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // let sum = (num1,num2) => {
        //     return num1+num2
        // }

        let sum = (num) => {
            return function(num1){
                return num + num1
            }
        }
        
        console.log(sum(2)(3));

        let arr = [10,5,11,7,8,9];

        function maxFun(arr){
            return Math.max.apply(null,arr) - Math.min.apply(null,arr)
        }

        console.log(maxFun(arr))

    </script>
</body>
</html>